<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateMembersTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('members', function (Blueprint $table) {
//            $table->engine = '';
            $table->bigIncrements('id')->comment('自增ID');
            $table->string('username', 100)->unique()->comment('用户名');
            $table->string('password', 255)->comment('密码');
            $table->string('avatar', 255)->comment('头像');
            $table->dateTime('last_login_at')->comment('最近登录时间');
            $table->string('last_login_ip', 50)->comment('最近登录ip');
            $table->dateTime('register_at')->comment('注册时间');
            $table->tinyInteger('status')->default(1)->comment('状态:0禁用，1启用');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('members');
    }
}
